package cn.topartip.controller;

import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Map;

@RestController
public class FallBackController {
    @RequestMapping("/beat")
    public String beat(){
        return "alive";
    }
    @RequestMapping("/fallback")
    public String index(){
        Map map = new HashMap<String,String>();
        map.put("status",0);
        map.put("msg","服务忙请稍后再试");
        return JSON.toJSONString(map);
    }
    @RequestMapping("/noRouter")
    public String noRouter(){
        Map map = new HashMap<String,String>();
        map.put("status",0);
        map.put("msg","路由不存在");
        return JSON.toJSONString(map);
    }
}
